<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/params.php')
);

return [
    'id' => 'basic-admin',
    'name' => '以稀网',
    'language' => 'en',
    'timeZone' => 'Asia/Shanghai',
    'basePath' => dirname(__DIR__),
    'controllerNamespace' => 'website\controllers',
    'defaultRoute' => 'welcome/index',
    'components' => [
        'db' => require(__DIR__ . '/../../common/config/db.php'),
      	'redis' => require(__DIR__ . '/../../common/config/redis.php'),
        'user' => [ 
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => true,
            'enableSession' => false
        ],
        // 禁用 assset jquery / bootstrap
        'assetManager'=>[
            'bundles'=>[
                'yii\bootstrap\BootstrapAsset' => [
                    'css' => []
                ],
                'yii\web\JqueryAsset' => [
                    'sourcePath' => null,
                    'js' => []
                ],
            ],
        ],
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'log' => [
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'redis' => [
            'class' => 'yii\redis\Connection',
            'hostname' => '127.0.0.1',
            'port' => 6379,
            'database' => 1,
        ],
        'session' => [
            'class' => 'yii\redis\Session',
            'timeout' => 86400,
            'redis' => [
                'class' => 'yii\redis\Connection',
                'hostname' => '127.0.0.1',
                'port' => 6379,
            ],
        ],
        'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
            ],
        ],
        // 下面是扩展了系统的组件
        'request' => [
            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
            'cookieValidationKey' => 'GqsorrWN7wpLzUdc_AQrCfJfduth8hkV',
            'class' => 'common\components\Request',
        ],
        'view' => [
            'class' => 'common\components\View',
        ],
    ],
    'params' => $params,
];